package com.zhxy.controller.api;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhxy.controller.api.validate.TestForm;
import com.zhxy.controller.api.validate.annos.CheckToken;
import com.zhxy.controller.api.validate.annos.Validate;

@RestController
@RequestMapping("/api")
public class TestAPIController {

    @RequestMapping("/test")
    @ResponseBody
    @Validate
    public Object test(Integer age, String name, @Validate(isForm = true) TestForm form) {
        System.out.println("BBBBBBBBBBBBBBBBBBBBBBBBBB");
        return age + "：您好！";
    }

    @CheckToken
    @RequestMapping("/test2")
    public Object test2() {
        return "访问成功";
    }

    @RequestMapping("/1")
    public String testlimit() {
        return "请求test1";
    }

    @RequestMapping("/2")
    public String testlimit2() {
        return "请求test2";
    }

    @RequestMapping("/3")
    public String testlimit3() {
        return "请求test3";
    }

    @RequestMapping("/4")
    public String testlimit4() {
        return "请求test4";
    }

    @RequestMapping("/5")
    public String testlimit5() {
        return "请求test5";
    }

    @RequestMapping("/6")
    public String testlimit6() {
        return "请求test6";
    }

    @RequestMapping("/7")
    public String testlimit7() {
        return "请求test7";
    }

    @RequestMapping("/8")
    public String testlimit8() {
        return "请求test8";
    }

    @RequestMapping("/9")
    public String testlimit9() {
        return "请求test9";
    }

    @RequestMapping("/10")
    public String testlimit10() {
        return "请求test10";
    }

    @RequestMapping("/{userid}/11")
    public String testlimit11(@PathVariable("userid") String userid) {
        return "请求含有变量";
    }

}
